home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / mint / lib / mntlib44.zoo / mntlib / closedir.c < prev    next >
C/C++ Source or Header  |  1994-03-01  |  608b  |  36 lines

  1. /* closedir routine */
  2.  
  3. /* under MiNT (v0.9 or better) these use the appropriate system calls.
  4.  * under TOS or older versions of MiNT, they use Fsfirst/Fsnext
  5.  *
  6.  * Written by Eric R. Smith and placed in the public domain
  7.  */
  8.  
  9. #include <stdlib.h>
  10. #include <string.h>
  11. #include <types.h>
  12. #include <limits.h>
  13. #include <dirent.h>
  14. #include <errno.h>
  15. #include <osbind.h>
  16. #include <mintbind.h>
  17. #include "lib.h"
  18.  
  19. extern int __mint;
  20. extern ino_t __inode;    /* in stat.c */
  21.  
  22. int
  23. closedir(dirp)
  24.     DIR *dirp;
  25. {
  26.     int r;
  27.  
  28.     if (__mint > 8) {
  29.         r = (int)Dclosedir(dirp->handle);
  30.     } else {
  31.         r = 0;
  32.     }
  33.     free(dirp);
  34.     return r;
  35. }
  36.